Changes spatial activity across the daily cycle
gam_fox_sp <- bam(fox ~ t2(x, y, hour, d = c(2, 1), bs = c("ds", "cc"), k = c(80, 8), m = c(1, 0.5), full = TRUE) +
s(foxbaits, bs = "tp", k = 4) +
s(station, bs = "re") +
offset(log(survey_duration)),
data = records, family = nb, knots = list(hour = c(0, 23)), nthreads = 3, discrete = TRUE)
summary(gam_fox_sp)
##
## Family: Negative Binomial(0.864)
## Link function: log
##
## Formula:
## fox ~ t2(x, y, hour, d = c(2, 1), bs = c("ds", "cc"), k = c(80,
## 8), m = c(1, 0.5), full = TRUE) + s(foxbaits, bs = "tp",
## k = 4) + s(station, bs = "re") + offset(log(survey_duration))
##
## Parametric coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.3843 0.1128 -74.32 <0.0000000000000002 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Approximate significance of smooth terms:
## edf Ref.df F p-value
## t2(x,y,hour) 79.400 559.000 21.843 0.000000469 ***
## s(foxbaits) 2.797 2.911 43.307 < 0.0000000000000002 ***
## s(station) 688.901 1231.000 3.029 < 0.0000000000000002 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## R-sq.(adj) = 0.117 Deviance explained = 35.2%
## fREML = 91177 Scale est. = 1 n = 87816
gam_cat_sp <- bam(cat ~ t2(x, y, hour, d = c(2, 1), bs = c("ds", "cc"), k = c(80, 8), m = c(1, 0.5), full = TRUE) +
s(station, bs = "re") +
offset(log(survey_duration)),
data = records, family = nb, knots = list(hour = c(0, 23)), nthreads = 3, discrete = TRUE)
summary(gam_cat_sp)
##
## Family: Negative Binomial(2.188)
## Link function: log
##
## Formula:
## cat ~ t2(x, y, hour, d = c(2, 1), bs = c("ds", "cc"), k = c(80,
## 8), m = c(1, 0.5), full = TRUE) + s(station, bs = "re") +
## offset(log(survey_duration))
##
## Parametric coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -8.07559 0.05587 -144.5 <0.0000000000000002 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Approximate significance of smooth terms:
## edf Ref.df F p-value
## t2(x,y,hour) 57.16 559 7.375 <0.0000000000000002 ***
## s(station) 505.82 1231 1.240 <0.0000000000000002 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## R-sq.(adj) = 0.0772 Deviance explained = 23.2%
## fREML = 87198 Scale est. = 1 n = 87816